home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 2 / Gold Medal Software Volume 2 (Gold Medal) (1994).iso / prog / fdate80a.arj / HOLIDAYS.BAT < prev    next >
DOS Batch File  |  1993-07-20  |  8KB  |  173 lines

  1. @echo off
  2. CLS
  3. goto EndDoc
  4. ----------------------------------------------------------------------
  5. HOLIDAYS.BAT for FDATE version 4.3a
  6. ===================================
  7. If you have any corrections to the algorithms
  8. in this batch file, please send them to Steve Ferg.
  9.  
  10. If environment variable RAMDISK is set before running this batch
  11. file, then it will use the RAM disk and run a bit faster.
  12. ----------------------------------------------------------------------
  13. Revision history:
  14. ===================================
  15. 4.2b Jan 6, 1992
  16.      Corrected algorithm for Advent (thanks to L. Schliesser)
  17. 4.2c Jan 10, 1992
  18.      Added entry for LABOR DAY (1st Monday in Sept) (thanks to L. S.)
  19. 4.3a Jan 12, 1992
  20.      Removed all /Imm-dd-ccyy and /Od1, since those are now the default.
  21. 4.4a Jan 20, 1992
  22.      Added beginning of Black History month to demonstrate new /S
  23.      Added x'FF' in Black History month entry to demonstrate formatting
  24. 6.1a Feb 14, 1992
  25.      Now use new /V parm to set environment variables.
  26. 6.2a Feb 19, 1992
  27.      Return to using batch file to set environment variables,
  28.            for users of 4DOS and NDOS, for whom /V will not work
  29. 7.0a Nov 23, 1992
  30.      added Canadian Thanksgiving Day
  31. ----------------------------------------------------------------------
  32. :EndDoc
  33.  
  34. if not (%1)==() goto nohelp
  35. echo ───────────────────────────────────────────────────────────────────────────────
  36. echo                   HOW TO USE HOLIDAYS.BAT
  37. echo ───────────────────────────────────────────────────────────────────────────────
  38. ECHO HOLIDAYS without any parameters displays events in current year.
  39. ECHO.
  40. ECHO HOLIDAYS [year]                 displays events in [year].
  41. ECHO EXAMPLE: HOLIDAYS 1999          displays events in year 1999.
  42. ECHO.
  43. ECHO.
  44. ECHO.
  45. ECHO To print the calendar, press SHIFT+PRINTSCREEN to print each screen.
  46. ECHO.
  47. pause
  48. cls
  49. :nohelp
  50.  
  51.  
  52. rem --------------------------------------------------------
  53. rem get current year
  54. rem --------------------------------------------------------
  55. Fdate /Ff /At /Occyy /P"@set year=" >%RAMDISK%JUNKTEMP.BAT
  56. call %RAMDISK%JUNKTEMP.BAT
  57.  
  58.  
  59. REM if user specifies a year as parm1, use it
  60. if not (%1)==() set year=%1
  61.  
  62.  
  63. rem --------------------------------------------------------
  64. rem Determine if year is a leapyear
  65. rem AND check for validity of year parm (%1)
  66. rem --------------------------------------------------------
  67. Fdate /Ff /A01-01-%year% /Oly /P"@set LY=" >%RAMDISK%JUNKTEMP.BAT
  68. call %RAMDISK%JUNKTEMP.BAT
  69. if (%LY%)==(ERROR) echo Parm #1 was not a valid year: %1
  70. if (%LY%)==(ERROR) goto endit
  71.  
  72.  
  73.  
  74. echo ───────────────────────────────────────────────────────────────────────────────
  75. if (%LY%)==(0) ECHO                   EVENTS IN %YEAR%
  76. if (%LY%)==(1) ECHO                   EVENTS IN %YEAR%         Note: %year% is a leap year
  77. echo ───────────────────────────────────────────────────────────────────────────────
  78. Fdate /Ff         /A01-01-%year% /P"New Year's Day........................"
  79. Fdate /Ff         /A01-06-%year% /P"Epiphany.............................."
  80.  
  81. Fdate /Fw /D2 /N3 /A01-01-%year% /P"Martin Luther King, Jr. Day..........."
  82. Fdate /Ff /A02-01-%year% /P"    Note that " /S" begins Black History Month"
  83. rem   note use of x'ff'     ^^^^ for formatting
  84. Fdate /Ff         /A02-14-%year% /P"Valentine's day......................."
  85. Fdate /Fw /D2 /N3 /A02-01-%year% /P"Presidents' Day......................."
  86. Fdate /Ff         /A03-17-%year% /P"St. Patricks's Day...................."
  87.  
  88. if (%LY%)==(1) Fdate /Ff /A02-29-%year% /P"Sadie Hawkins Day....................."
  89.  
  90. REM ========== begin: DATES TIED TO EASTER==============================
  91. set easter=
  92. if (%year%)==(1991) set easter=03-31-%year%
  93. if (%year%)==(1992) set easter=04-19-%year%
  94. if (%year%)==(1993) set easter=04-11-%year%
  95. if (%year%)==(1994) set easter=04-03-%year%
  96. if (%year%)==(1995) set easter=04-16-%year%
  97. if (%year%)==(1996) set easter=04-07-%year%
  98. if (%year%)==(1997) set easter=03-30-%year%
  99. if (%year%)==(1998) set easter=04-12-%year%
  100. if (%year%)==(1999) set easter=04-04-%year%
  101. if (%year%)==(2000) set easter=04-23-%year%
  102. if (%year%)==(2001) set easter=04-15-%year%
  103. if (%easter%)==() goto unknown
  104. echo.
  105. Fdate /Fsub /N40 /A%easter% /P"Mardi Gras (Shrove Tuesday)..........."
  106. Fdate /Fsub /N46 /A%easter% /P"Ash Wednesday (Lent begins)..........."
  107. Fdate /Fsub /N7  /A%easter% /P"Palm Sunday..........................."
  108. Fdate /Fsub /N2  /A%easter% /P"Good Friday..........................."
  109. Fdate /Ff        /A%easter% /P"Easter................................"
  110. :unknown
  111. REM ==========   end: DATES TIED TO EASTER==============================
  112.  
  113. echo ───────────────────────────────────────────────────────────────────────────────
  114. PAUSE
  115. CLS
  116.  
  117. Fdate /Fw /D4 /N4  /A04-01-%year% /P"Secretary's Day......................."
  118. Fdate /Ff          /A05-05-%year% /P"Cinco de Mayo (Mexico)................"
  119.  
  120. Fdate /Fw /D1 /N2  /A05-01-%year% /P"Mother's Day.........................."
  121. Fdate /Fw /D2 /N-1 /A05-24-%year% /P"Victoria Day (Canada)................."
  122. Fdate /FW /D2 /N-1 /A05-31-%year% /P"Memorial Day (observed)..............."
  123.  
  124. if not (%easter%)==() Fdate /Fadd /N39 /A%easter% /P"Ascension Day........................."
  125. if not (%easter%)==() Fdate /Fadd /N49 /A%easter% /P"Pentecost............................."
  126. if not (%easter%)==() echo.
  127. Fdate /Ff         /A06-14-%year% /P"Flag Day.............................."
  128. rem ----- anniversary of Bloom's Day, June 16, 1904 ------------------
  129. rem Here's a way to show an anniversary or event that you want to note.
  130. rem Thanks to L. Schliesser for the algorithm.
  131. rem ------------------------------------------------------------------
  132. Fdate /F#dif /A%year% /B1904 /P"@set ann=" >%RAMDISK%JUNKTEMP.BAT
  133. call %RAMDISK%JUNKTEMP.BAT
  134. Fdate /Ff         /A06-16-%year% /P"Bloom's Day (%ann%th anniversary)........"
  135. SET ann=
  136. rem ---------------end bloom's day --------------------------------------
  137.  
  138. Fdate /Fw /D1 /N3 /A06-01-%year% /P"Father's Day.........................."
  139. Fdate /Ff         /A07-01-%year% /P"Canada Day (Canada)..................."
  140. Fdate /Ff         /A07-04-%year% /P"Independence Day (USA)................"
  141. Fdate /Ff         /A07-14-%year% /P"Bastille Day (France)................."
  142.  
  143. rem echo ───────────────────────────────────────────────────────────────────────────────
  144. rem PAUSE
  145. rem CLS
  146.  
  147. Fdate /Fw /D2 /N1 /A09-01-%year% /P"Labor Day............................."
  148.  
  149.  
  150. rem ---- begin ------- note a particular day in a particular year
  151. rem This technique is useful for noting special events:
  152. rem 21st birthdays, 50th wedding anniversaries, etc.
  153. if (%year%)==(1992) Fdate /Ff /A10-12-%year% /P"500th ann. of Columbus's discovery...."
  154. rem ----  end -------- note a particular day in a particular year
  155.  
  156. Fdate /Fw /D2 /N2  /A10-01-%year% /P"Columbus Day (observed)..............."
  157. Fdate /Fw /D2 /N2  /A10-01-%year% /P"Thanksgiving Day (Canada)............."
  158. Fdate /Ff          /A11-11-%year% /P"Veteran's Day........................."
  159.  
  160. rem third thursday in November
  161. Fdate /Fw /D5 /N4  /A11-01-%year% /P"Thanksgiving Day (USA)................"
  162.  
  163.  
  164. Fdate /Fw /D1 /N-4 /A12-24-%year% /P"First Sunday in Advent................"
  165. Fdate /Ff          /A12-25-%year% /P"Christmas............................."
  166. Fdate /fadd /N1    /A12-31-%year% /P"New Year's Day........................"
  167. echo ───────────────────────────────────────────────────────────────────────────────
  168. :endit
  169. DEL %RAMDISK%JUNKTEMP.BAT>nul
  170. set year=
  171. set easter=
  172. set LY=
  173.